<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h2>类型转换</h2>
</body>
<script>
    //1.数字转换成字符串
    // let num = 123 + '';
    // let num = String(123);

    //2.字符串转换成数字
    //let str = '12345abc' * 1
    // let str = parseInt('12345.34664')
    // let str2 = parseFloat('12345.34664')
    //let str = +'12345'

    // let str = parseInt('12345abc')

    //  console.log(str)

    //3.转换成布尔型
    let num = 0;
    //  console.log(!!num)
    //  console.log(Boolean(num))
</script>

</html>